package com.heima.review.config;

import com.heima.review.interceptor.ReviewInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new ReviewInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login/in")
                .excludePathPatterns("/api/v1/article/findById/{id}")
                .excludePathPatterns("/api/v1/comment/del_comment/{commentId}")
                .excludePathPatterns("/api/v1/comment/manage/list")
                .excludePathPatterns("/api/v1/comment/del_comment_repay/{commentRepayId}")
                .excludePathPatterns("/api/v1/comment/del_comment/{articleId}");

    }
}
